﻿namespace DotNetStar.OpenSDK
{
    using WeChat;

    /// <summary>
    /// 微信 SDK。
    /// </summary>
    public static class WeChatSdkExtensions
    {
        /// <summary>
        /// 表示使用微信的功能
        /// </summary>
        /// <param name="sdk">The SDK.</param>
        /// <returns></returns>
        public static WeChatPlatform WeChat(this SDK sdk) => sdk.GetOpenPlatform<WeChatPlatform>();

        /// <summary>
        /// 微信开放平台。
        /// </summary>
        /// <param name="weChat"></param>
        /// <returns>微信开放平台的实例。</returns>
        public static WeChatOpenPlatform Open(this WeChatPlatform weChat) => SDK.Use.GetOpenPlatform<WeChatOpenPlatform>();

        /// <summary>
        /// 微信公众平台。
        /// </summary>
        /// <param name="weChat">开放平台的扩展实例。</param>
        /// <returns>微信公众平台</returns>
        public static WeChatMPPlatform MP(this WeChatPlatform weChat) => SDK.Use.GetOpenPlatform<WeChatMPPlatform>();


        /// <summary>
        /// 微信支付平台。
        /// </summary>
        /// <param name="weChat">开放平台的扩展实例。</param>
        /// <returns>微信支付平台。</returns>
        public static WeChatPayPlatform Pay(this WeChatPlatform weChat) => SDK.Use.GetOpenPlatform<WeChatPayPlatform>();
    }
}
